﻿using LPY.LeHealth.DTO;
using LPY.LeHealth.Model;
using LPY.LeHealth.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace LPY.LeHealth.WebSite.Controllers
{
    public class BaseController : Controller
    {
        /// <summary>
        /// 当期用户
        /// 未登录返回Null
        /// </summary>
        public UserDTO CurrentUser
        {
            get
            {
                var user = Session[CommonService.UserSessionName] as UserDTO;
                return user;
            }
        }

        /// <summary>
        /// 当前管理员
        /// </summary>
        public UserDTO CurrentAdmin
        {
            get
            {
                var user = Session[CommonService.AdminSessionName] as UserDTO;
                return user;
            }
        }

        /// <summary>
        /// 当前医院
        /// </summary>
        public UserDTO CurrentHospital
        {
            get
            {
                var user = Session[CommonService.HospitalSessionName] as UserDTO;
                return user;
            }
        }
	}
}